package sf.actions;

import java.awt.event.ActionEvent;

import sf.view.StandardForm;

public class ActionSelectFirst extends SFAbstractAction {

	private static final long serialVersionUID = 1L;

	private StandardForm parentForm;

	ActionSelectFirst(StandardForm parentForm) {
		this.parentForm = parentForm;
		// putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_U,
		// ActionEvent.CTRL_MASK));
		// putValue(MNEMONIC_KEY, KeyEvent.VK_U);
		putValue(SMALL_ICON, loadIcon("img/prvi.png"));
		putValue(NAME, "<<");
		putValue(SHORT_DESCRIPTION, "Selektuj prvi");
	}

	public void actionPerformed(ActionEvent e) {
		parentForm.getBrowser().selectFirstRow();
	}

	public void setButtonMode(int mode) {
		if ((mode&StandardForm.MODE_EDIT) != 0)
			this.setEnabled(true);
		else
			this.setEnabled(false);
	}
}
